frontend: Further improve frontend performance (focused on allocations)#959
Merged
Conversation
flofriday
force-pushed
the
feature/even-further-frontend-improvements
branch
2 times, most recently
from
May 13, 2026 21:40
6d11af0 to
a8603e6
Compare
Contributor
|
JFYI: I am waiting with the review till all tests pass |
flofriday
force-pushed
the
feature/even-further-frontend-improvements
branch
5 times, most recently
from
May 14, 2026 20:52
8d3f7ff to
06b6fee
Compare
Contributor
Author
|
@Jozott00 the tests are finally passing :) |
flofriday
enabled auto-merge
May 15, 2026 09:42
flofriday
force-pushed
the
feature/even-further-frontend-improvements
branch
2 times, most recently
from
May 15, 2026 12:28
345ffd6 to
1f12c7c
Compare
This approach allocates fewer intermediate lists.
We often want to make copies of nodes (macro expanding) or create them syntactically. Some of the code reparsed the tokens again which wasn't needed.
Most definitions don't have any annotations, so avoiding a lot of work early saves us 15MB here.
Some macros were expanded twice. This was due to a bug in the macro expander where macro arguments weren't copied properly and so using it twice resulted in only two places pointing to the same node. The hack fixed that by simply expanding it once again but at great cost to performance and memory allocations.
flofriday
force-pushed
the
feature/even-further-frontend-improvements
branch
from
May 15, 2026 12:30
1f12c7c to
ddce04f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This time I tried to get the allocation down.
So far the
checkcommand on aarch32 now needs 380MB less memory.Performance wise, this also improves the frontend by 71ms on the spec.
Protocol
Related PRs: #947 #933